package com.voa.web.ajax;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.Action;
import com.voa.domain.BlogReply;
import com.voa.service.BlogReplyService;
import com.voa.service.BlogService;

/**
 * <p>程序名称：       BlogAjaxAction.java</p>
 * <p>程序说明：       日志Ajax</p>
 * <p>版权信息：       Copyright 深圳市维远泰克科技有限公司</p>
 * <p>时间：          Feb 11, 2011 11:44:59 AM</p>	
 * 
 * @author：          Marker.King
 * @version：         Ver 0.1
 */
@Controller
@Scope("prototype")
public class BlogAjaxAction {

	@Autowired
	private BlogService blogService;
	@Autowired
	private BlogReplyService blogReplyService;
	
	private String id;
	private BlogReply blogReply;
	
	public String deleteBlog() throws Exception {
		blogService.deleteBlog(id);
		return Action.SUCCESS;
	}
	
	public String reply() throws Exception {
		blogReply = blogReplyService.saveBlogReply(blogReply);
		return Action.SUCCESS;
	}
	
	public String deleteReply() throws Exception {
		blogReplyService.deleteBlogReply(id);
		return Action.SUCCESS;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public BlogReply getBlogReply() {
		return blogReply;
	}

	public void setBlogReply(BlogReply blogReply) {
		this.blogReply = blogReply;
	}

}